<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('风险事件列列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <input th:value="${orgId}" type="hidden">
                        <ul>
                            <li >
                                <label >示范区：</label>

                                <select  name="orgId"   onchange="selectOnchang(this.value)"  th:with="type=${rOrgs}">
                                    <option   th:each="dict:${type}"   th:value="${dict.id}" th:text="${dict.name}"  th:selected="${dict.id eq orgId}" ></option>
                                </select>
                            </li>
                            <li>
                                <label>风险等级：</label>
                                <input type="text" placeholder="例如：1" name="ristType"/>
                            </li>
                            <li>
                                <label>风险类型：</label>
                                <input type="text"  name="riskType"/>
                            </li>
                            <li>
                                <label>精度(>=)：</label>
                                <input type="text" placeholder="例如：0.9" name="accuracy"/>
                            </li>
                            <li class="select-time">
                                <label>发生时间： </label>
                                <input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginTime]"/>
                                <span>-</span>
                                <input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endTime]"/>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                                <a class="btn btn-sm btn-info"th:href="'/system/main?orgId='+${orgId}"  ><i class="fa fa-arrows-alt"></i>&nbsp;返回大屏</a>
                                <a class="btn btn-sm btn-info" th:href="@{/index}"><i class="fa fa-refresh"></i>&nbsp;管理后台</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>

<!--            <div class="btn-group-sm" id="toolbar" role="group">-->
<!--                <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:event:add">-->
<!--                    <i class="fa fa-plus"></i> 添加-->
<!--                </a>-->
<!--                <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="system:event:edit">-->
<!--                    <i class="fa fa-edit"></i> 修改-->
<!--                </a>-->
<!--                <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:event:remove">-->
<!--                    <i class="fa fa-remove"></i> 删除-->
<!--                </a>-->
<!--                <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:event:export">-->
<!--                    <i class="fa fa-download"></i> 导出-->
<!--                </a>-->
<!--            </div>-->
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('system:event:edit')}]];
        var removeFlag = [[${@permission.hasPermi('system:event:remove')}]];
        var datas = [[${@dict.getType('fx_org')}]];

        var prefix = ctx + "system/event";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                modalName: "风险事件列",
                columns: [{
                    checkbox: true
                },
                {
                    field: 'id',
                    title: '主键id',
                    visible: false
                },
                {
                    field: 'orgId',
                    title: '机构ID',
                    formatter: function(value, row, index) {
                        return $.table.selectDictLabel(datas, value);
                    },
                },
                {
                    field: 'name',
                    title: '风险名称'
                },
                    {
                        field: 'riskType',
                        title: '风险类型'
                    },
                    {
                        field: 'ristType',
                        title: '风险等级'
                    },
                    {
                        field: 'createTime',
                        title: '时间'
                    },
                    {
                        field: 'coordinate',
                        title: '坐标'
                    },
                    {
                        field: 'device',
                        title: '设备'
                    },
                    {
                        field: 'accuracy',
                        title: '精度'
                    },
                {
                    field: 'remark',
                    title: '备注'
                },
                {
                    title: '查看',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs" target="_blank" href="' + ctx + row.pictureAddress + '" >查看图片</a> ');
                        actions.push('<a class="btn btn-success btn-xs" target="_blank" href="'+ ctx  + row.videoAddress + '" >查看视频</a>');
                        return actions.join('');
                    }
                }
                ]
            };
            $.table.init(options);
        });
        function selectOnchang(obj){
            $.treeTable.search();
        }
    </script>
</body>
</html>